﻿<!DOCTYPE html>
<html class="login-alone">
    <head>
        <title>修改密码 </title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

        <link href="__PUBLIC__/css/retpwd/ui/css/screen.css?v=3.9" media="screen, projection" rel="stylesheet" type="text/css" >
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/retpwd/ui/css/base.css?v=3.9">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/retpwd/passport/css/login.css?v=3.9">
        <script type="text/javascript" src="__PUBLIC__/js/jquery-2.1.3.min.js"></script>

    </head>
    <body>
        <div class="logina-logo" style="height: 55px;padding: 10px 0;">
           
        </div>
        <div class="logina-main main clearfix" style="width: 460px">
            <div class="tab-con" style="padding: 0">
                <form id="form-login" method="post" action="{:U('Home/Login/ModPwdCon')}">
                    <div id='login-error' class="error-tip"></div>
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <th>密码</th>
                                <td width="245">
                                    <input id="password" type="password" name="pass" placeholder="6-20个字母数字的组合密码" autocomplete="off" value=""></td>
                                <td>
                                <span id="spanId" style="font-size: 12px"></span>
                                </td>
                            </tr>
                            <tr>
                                <th>确认密码</th>
                                <td width="245">
                                    <input id="repass" type="password" name="repass" placeholder="请再次输入密码" autocomplete="off">
                                </td>
                                <td>
                                <span id="spanId2" style="font-size: 12px"></span>
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td width="245"><input class="confirm" type="submit" value="确认提交" style="font-size: 22px"></td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>
                    <input type="hidden" name="refer" value="site/">
                </form>
            </div>
        </div>
        <script>
            $("#password").blur(function(){
                var pass = $(this).val();
                if(pass==""){
                    $('#spanId').css('color','red').text('请输入密码');
                    // return;
                }else if((pass.length>0 && pass.length<6) || pass.length>20){
                    $('#spanId').css('color','red').text('密码长度不合规');
                    // return;
                }else{
                    $.ajax({
                        'url':'{:U("Home/Login/TesPwdCom")}',
                        'data':'pass='+$(this).val(),
                        'type':'POST',
                        'success':function(data){
                            console.log(data);
                             if(data=="non"){
                                 $('#spanId').css('color','red').text('密码不合规');
                             }else{
                                $('#spanId').css('color','red').text('');
                             }
                        }
                    });
                }

            })

            $('#repass').blur(function(){
                // alert('dddd');
                if($(this).val()!=$('#password').val()){
                    $('#spanId2').css('color','red').text('密码不一致');
                }else{
                    $('#spanId2').css('color','red').text('');
                }
            })
        </script>
        <div id="footer">
            <div class="copyright">Copyright © 2014 js-css.cn. All Rights Reserved. </div>
        </div>
  
    </body>
</html>
